<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="checkbox" >9
    <input type="checkbox" >15
    <input type="checkbox" >19
    <input type="checkbox" >25
    <input type="checkbox" >29
    <input type="checkbox" >31
    <input type="checkbox" >48
    <input type="checkbox" >57
    <input type="checkbox" >62
    <input type="checkbox" >79
    <input type="checkbox" >87
    <p>你选中的元素，累加的值和为:{{0}}</p>
</body>
</html>
<script>
    var arr=[10,20,30,40,50]
    var sum=0
    for(var i=0;i<arr.length;i++){
        sum+=arr[i]
    }
    console.log(sum+i);
</script>